--赤霄·拔刀
local chixiaobadao = fk.CreateSkill {
    name = "mcdh_chixiaobadao",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

chixiaobadao:addEffect(fk.EventPhaseEnd,{
    can_trigger = function(self, event, target, player, data)
        return  player:hasSkill(self) and player ~= target and target.phase == Player.Play and player:getMark("mcdh_charge") >= 3 and #target:getCardIds("h") > 0 and (#target:getCardIds("h") >= #player:getCardIds("h") or #target:getCardIds("h") >= target.hp)
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        lib.LoseCharge(player,player,3,self.name)
        local id = room:askForCardChosen(player, target, "h", self.name)
        room:moveCards({
            ids = {id} ,
            from = target.id,
            to = player.id,
            toArea = Card.PlayerHand,
            moveReason = fk.ReasonPrey,
            skillName =  self.name,
            moveVisible = false
        })
        room:useVirtualCard("slash", nil, player,target, self.name, false)
    end
})

Fk:loadTranslationTable {
    ["mcdh_chixiaobadao"] = "赤霄·拔刀",
    [":mcdh_chixiaobadao"] = "蓄力技(3)，其他角色的出牌阶段结束时，若其手牌数不小于其体力值或你的手牌数，你可以获得其一张手牌，视为对其使用一张无距离限制的【杀】。",
}

return chixiaobadao